﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebHiLoDemo
{
    public partial class Auto : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private static Random random = new Random();
        private int GetRandom()
        {
            return random.Next(1, 130000001) % 13 + 1;
        }

        private void Execute()
        {
            int[] arr = new int[13];
            for (int i = 0; i < 13; i++)
                arr[i] = 0;

            int n = 1300;
            for (int i = 0; i < n; i++)
            {
                int v = GetRandom()-1;
                arr[v]++;
            }

            Label0.Text = string.Format(" {0} lần ", n);

            int t = 0;
            Label1.Text = arr[t++].ToString();
            Label2.Text = arr[t++].ToString();
            Label3.Text = arr[t++].ToString();
            Label4.Text = arr[t++].ToString();
            Label5.Text = arr[t++].ToString();
            Label6.Text = arr[t++].ToString();
            Label7.Text = arr[t++].ToString();
            Label8.Text = arr[t++].ToString();
            Label9.Text = arr[t++].ToString();
            Label10.Text = arr[t++].ToString();
            Label11.Text = arr[t++].ToString();
            Label12.Text = arr[t++].ToString();
            Label13.Text = arr[t++].ToString();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Execute();
        }
    }
}